package com.bsth.entity;

import com.bsth.entity.schedule.BEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.annotations.Formula;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @ClassName : Cars(车实体类)
 * 
 * @Author : bsth@lq
 * 
 * @Description : TODO(车辆基本信息)
 * 
 * @Data : 2016-04-27
 *
 * @Version ﻿公交调度系统BS版 0.1
 * 
 */

@Entity
@Table(name = "bsth_c_cars")
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
public class Cars extends BEntity implements Serializable {
	
	/** 主键Id */
	@Id
	@GeneratedValue
	private Integer id;

    /** 自编号/内部编号 */
    @Column(nullable = false, length = 20, unique = true)
    private String insideCode;

    // 公司、分公司暂时不用关联实体
    /** 公司代码 */
    @Column(nullable = false)
    private String businessCode;
    /** 公司名称 */
    @Column(nullable = false)
    private String company;
    /** 分公司编码 */
    private String brancheCompanyCode;
    /** 分公司 */
    private String brancheCompany;

    /** 组合公司分公司编码 */
    @Formula(" concat(business_code, '_', branche_company_code) ")
    private String cgsbm;

    /** 车辆编码（TODO：在原系统里没有，这里暂时留着） */
    @Column(nullable = false)
	private String carCode;
    /** 车牌号 */
    @Column(nullable = false)
	private String carPlate;
    /** 供应商名称 */
    @Column(nullable = false)
    private String supplierName;
    /** 设备终端号 */
    @Column(nullable = false)
    private String equipmentCode;
    
    // 以下信息来自总公司的业务系统，可能需要调用相关接口
	/** 车型类别 */
	private String carClass ;
    /** 技术速度 */
    private Double speed;
    /** 座位数 */
	private  Integer carSeatnNumber;
	/** 载客标准 */
	private String carStandard;
    /** 标准油耗(开空调) */
    private Double kburnStandard;
    /** 标准油耗(关空调) */
    private Double gburnStandard;
    /** 报废号 */
    private String scrapCode;
    /** 报废日期 */
    private Date scrapDate;
    /** 厂牌型号1 */
    private String makeCodeOne;
    /** 厂牌型号2 */
    private String makeCodeTwo;
    /** 车辆等级标准 */
    private String carGride;
    /** 出厂排放标准 */
    private String emissionsStandard;
    /** 发动机号码1 */
    private String engineCodeOne;
    /** 发动机号码2 */
    private String engineCodeTwo;
    /** 车架号码1 */
    private String carNumberOne;
    /** 车架号码2 */
    private String carNumberTwo;
    /** 启用日期（2008-10-10）*/
    private Date openDate;
    /** 取消日期 */
    private Date closeDate;

	/** 是否空调车 */
    @Column(nullable = true)
    private Boolean hvacCar;
	/** 有无人售票 */
    @Column(nullable = true)
	private Boolean ticketType;
    /** 是否有LED服务屏 */
    @Column(nullable = true)
    private Boolean ledScreen;
	/** 是否有TV视频 */
    @Column(nullable = true)
	private Boolean tvVideoType;

	/** 车辆类型 */
	private String carType;
    /** 是否机动车（机动车类型选择）*/
    private String vehicleStats;
    /** 营运状态 */
    private String operatorsState;
    /** 营运证编码 */
    private String serviceNo;
    /** 是否电车（TODO：在原系统里没有，这里暂时留着） */
    private Boolean sfdc;
    /** 备注/描述 */
    private String descriptions;

	/** 车辆序号（TODO：在原系统里没有，这里暂时留着） */
	private String carOrdinal;
	/** 视频编号 */
	private String videoCode;
	/** 是否报废 */
    @Column(nullable = true)
	private Boolean scrapState;
	/** 是否切换（TODO：在原系统里没有，这里暂时留着）*/
	private Integer isSwitch;
    /** 线路名称（TODO：在原系统里没有，这里暂时留着，并且不做线路关联，只保留个名字） */
    private String xlmc;

    public Cars() {}

    public Cars(Object id, Object nbbh, Object clbh, Object cph, Object sbbh) {
        if (id != null) {
            this.id = Integer.valueOf(id.toString());
        }
        if (nbbh != null) {
            this.insideCode = nbbh.toString();
        }
        if (clbh != null) {
            this.carCode = clbh.toString();
        }
        if (cph != null) {
            this.carPlate = cph.toString();
        }
        if (sbbh != null) {
            this.equipmentCode = sbbh.toString();
        }
    }
	
    public String getServiceNo() {
		return serviceNo;
	}

	public void setServiceNo(String serviceNo) {
		this.serviceNo = serviceNo;
	}

	public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getInsideCode() {
        return insideCode;
    }

    public void setInsideCode(String insideCode) {
        this.insideCode = insideCode;
    }

    public String getBusinessCode() {
        return businessCode;
    }

    public void setBusinessCode(String businessCode) {
        this.businessCode = businessCode;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getBrancheCompanyCode() {
        return brancheCompanyCode;
    }

    public void setBrancheCompanyCode(String brancheCompanyCode) {
        this.brancheCompanyCode = brancheCompanyCode;
    }

    public String getBrancheCompany() {
        return brancheCompany;
    }

    public void setBrancheCompany(String brancheCompany) {
        this.brancheCompany = brancheCompany;
    }

    public String getCarCode() {
        return carCode;
    }

    public void setCarCode(String carCode) {
        this.carCode = carCode;
    }

    public String getCarPlate() {
        return carPlate;
    }

    public void setCarPlate(String carPlate) {
        this.carPlate = carPlate;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getEquipmentCode() {
        return equipmentCode;
    }

    public void setEquipmentCode(String equipmentCode) {
        this.equipmentCode = equipmentCode;
    }

    public String getCarClass() {
        return carClass;
    }

    public void setCarClass(String carClass) {
        this.carClass = carClass;
    }

    public Double getSpeed() {
        return speed;
    }

    public void setSpeed(Double speed) {
        this.speed = speed;
    }

    public Integer getCarSeatnNumber() {
        return carSeatnNumber;
    }

    public void setCarSeatnNumber(Integer carSeatnNumber) {
        this.carSeatnNumber = carSeatnNumber;
    }

    public String getCarStandard() {
        return carStandard;
    }

    public void setCarStandard(String carStandard) {
        this.carStandard = carStandard;
    }

    public Double getKburnStandard() {
        return kburnStandard;
    }

    public void setKburnStandard(Double kburnStandard) {
        this.kburnStandard = kburnStandard;
    }

    public Double getGburnStandard() {
        return gburnStandard;
    }

    public void setGburnStandard(Double gburnStandard) {
        this.gburnStandard = gburnStandard;
    }

    public String getScrapCode() {
        return scrapCode;
    }

    public void setScrapCode(String scrapCode) {
        this.scrapCode = scrapCode;
    }

    public Date getScrapDate() {
        return scrapDate;
    }

    public void setScrapDate(Date scrapDate) {
        this.scrapDate = scrapDate;
    }

    public String getMakeCodeOne() {
        return makeCodeOne;
    }

    public void setMakeCodeOne(String makeCodeOne) {
        this.makeCodeOne = makeCodeOne;
    }

    public String getMakeCodeTwo() {
        return makeCodeTwo;
    }

    public void setMakeCodeTwo(String makeCodeTwo) {
        this.makeCodeTwo = makeCodeTwo;
    }

    public String getCarGride() {
        return carGride;
    }

    public void setCarGride(String carGride) {
        this.carGride = carGride;
    }

    public String getEmissionsStandard() {
        return emissionsStandard;
    }

    public void setEmissionsStandard(String emissionsStandard) {
        this.emissionsStandard = emissionsStandard;
    }

    public String getEngineCodeOne() {
        return engineCodeOne;
    }

    public void setEngineCodeOne(String engineCodeOne) {
        this.engineCodeOne = engineCodeOne;
    }

    public String getEngineCodeTwo() {
        return engineCodeTwo;
    }

    public void setEngineCodeTwo(String engineCodeTwo) {
        this.engineCodeTwo = engineCodeTwo;
    }

    public String getCarNumberOne() {
        return carNumberOne;
    }

    public void setCarNumberOne(String carNumberOne) {
        this.carNumberOne = carNumberOne;
    }

    public String getCarNumberTwo() {
        return carNumberTwo;
    }

    public void setCarNumberTwo(String carNumberTwo) {
        this.carNumberTwo = carNumberTwo;
    }

    public Date getOpenDate() {
        return openDate;
    }

    public void setOpenDate(Date openDate) {
        this.openDate = openDate;
    }

    public Date getCloseDate() {
        return closeDate;
    }

    public void setCloseDate(Date closeDate) {
        this.closeDate = closeDate;
    }

    public Boolean getHvacCar() {
        return hvacCar;
    }

    public void setHvacCar(Boolean hvacCar) {
        this.hvacCar = hvacCar;
    }

    public Boolean getTicketType() {
        return ticketType;
    }

    public void setTicketType(Boolean ticketType) {
        this.ticketType = ticketType;
    }

    public Boolean getLedScreen() {
        return ledScreen;
    }

    public void setLedScreen(Boolean ledScreen) {
        this.ledScreen = ledScreen;
    }

    public Boolean getTvVideoType() {
        return tvVideoType;
    }

    public void setTvVideoType(Boolean tvVideoType) {
        this.tvVideoType = tvVideoType;
    }

    public String getCarType() {
        return carType;
    }

    public void setCarType(String carType) {
        this.carType = carType;
    }

    public String getVehicleStats() {
        return vehicleStats;
    }

    public void setVehicleStats(String vehicleStats) {
        this.vehicleStats = vehicleStats;
    }

    public String getOperatorsState() {
        return operatorsState;
    }

    public void setOperatorsState(String operatorsState) {
        this.operatorsState = operatorsState;
    }

    public Boolean getSfdc() {
        return sfdc;
    }

    public void setSfdc(Boolean sfdc) {
        this.sfdc = sfdc;
    }

    public String getDescriptions() {
        return descriptions;
    }

    public void setDescriptions(String descriptions) {
        this.descriptions = descriptions;
    }

    public String getCarOrdinal() {
        return carOrdinal;
    }

    public void setCarOrdinal(String carOrdinal) {
        this.carOrdinal = carOrdinal;
    }

    public String getVideoCode() {
        return videoCode;
    }

    public void setVideoCode(String videoCode) {
        this.videoCode = videoCode;
    }

    public Boolean getScrapState() {
        return scrapState;
    }

    public void setScrapState(Boolean scrapState) {
        this.scrapState = scrapState;
    }

    public Integer getIsSwitch() {
        return isSwitch;
    }

    public void setIsSwitch(Integer isSwitch) {
        this.isSwitch = isSwitch;
    }

    public String getXlmc() {
        return xlmc;
    }

    public void setXlmc(String xlmc) {
        this.xlmc = xlmc;
    }

    public String getCgsbm() {
        return cgsbm;
    }

    public void setCgsbm(String cgsbm) {
        this.cgsbm = cgsbm;
    }
}
